home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / amiga.free / sorgenti vari / wolfedit2 2.0.4 source.sit / WolfEdit2 2.0.4 Source / UEditOther.p < prev    next >
Text File  |  1995-10-16  |  2KB  |  82 lines

  1. unit UEditOther;
  2.  
  3. interface
  4.     uses
  5.         UWolfDoc;
  6.  
  7.     procedure EditOther (mapList: TMapListDoc);
  8.  
  9. implementation
  10.     uses
  11.         UEditArt;
  12.  
  13.     const
  14.  
  15.         otherEditDlogID = 137;
  16.         menuItem = 2;
  17.         imageItem = 3;
  18.  
  19.         firstOtherBrgrID = 428;
  20.  
  21.     type
  22.  
  23.         TOtherEditDialog = object(TArtEditDialog)
  24.                 procedure IOtherEditDialog (itsMapList: TMapListDoc);
  25.                 procedure UninstallArt;
  26.                 override;
  27.                 procedure InstallArt;
  28.                 override;
  29.                 procedure ItemHit (var e: EventInfo; itemNo: integer);
  30.                 override;
  31.             end;
  32.  
  33.     procedure TOtherEditDialog.IOtherEditDialog (itsMapList: TMapListDoc);
  34.     begin
  35.         IArtEditDialog(otherEditDlogID, nil, itsMapList, false);
  36.         SelectArt(0);
  37.     end;
  38.  
  39.     procedure TOtherEditDialog.UninstallArt;
  40.     begin
  41.         if (fCurrentArt >= 0) & (fArtView.fChanged) then begin
  42.                 fMapList.InstallObjectArt(firstOtherBrgrID + fCurrentArt, fArtView.ExtractObject);
  43.                 fArtView.fChanged := false;
  44.             end;
  45.     end;
  46.  
  47.     procedure TOtherEditDialog.InstallArt;
  48.     begin
  49.         if fCurrentArt >= 0 then
  50.             fArtView.InstallObject(fMapList.GetObjectArt(firstOtherBrgrID + fCurrentArt));
  51.     end;
  52.  
  53.     procedure TOtherEditDialog.ItemHit (var e: EventInfo; itemNo: integer);
  54.     begin
  55.         case itemNo of
  56.             menuItem: 
  57.                 SelectArt(GetItemValue(menuItem) - 1);
  58.             otherwise
  59.                 inherited ItemHit(e, itemNo);
  60.         end;
  61.     end;
  62.  
  63.     procedure EditOther (mapList: TMapListDoc);
  64.         var
  65.             dlog: TOtherEditDialog;
  66.  
  67.         procedure CheckWindow (win: TWindow);
  68.         begin
  69.             if member(win, TOtherEditDialog) then begin
  70.                     win.Select;
  71.                     exit(EditOther);
  72.                 end;
  73.         end;
  74.  
  75.     begin
  76.         mapList.EachWindowDo(CheckWindow);
  77.         new(dlog);
  78.         dlog.IOtherEditDialog(mapList);
  79.         dlog.Show;
  80.     end;
  81.  
  82. end.